home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / mktime.z / mktime
Encoding:
Text File  |  1998-10-20  |  12.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. mmmmkkkkttttiiiimmmmeeee((((3333CCCC))))                                                          mmmmkkkkttttiiiimmmmeeee((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_kkkk_tttt_iiii_mmmm_eeee - converts a _tttt_mmmm structure to a calendar time
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_tttt_iiii_mmmm_eeee_...._hhhh_>>>>
  13.  
  14.      _tttt_iiii_mmmm_eeee______tttt _mmmm_kkkk_tttt_iiii_mmmm_eeee _((((_ssss_tttt_rrrr_uuuu_cccc_tttt _tttt_mmmm _****_tttt_iiii_mmmm_eeee_pppp_tttt_rrrr_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _mmmm_kkkk_tttt_iiii_mmmm_eeee converts the time represented by the _tttt_mmmm structure pointed to by
  18.      _t_i_m_e_p_t_r into a calendar time (the number of seconds since 00:00:00 UTC,
  19.      January 1, 1970).
  20.  
  21.      The _tttt_mmmm structure has the following format.
  22.  
  23.           _ssss_tttt_rrrr_uuuu_cccc_tttt    _tttt_mmmm _{{{{
  24.                _iiii_nnnn_tttt  _tttt_mmmm______ssss_eeee_cccc_;;;;   _////_**** _ssss_eeee_cccc_oooo_nnnn_dddd_ssss _aaaa_ffff_tttt_eeee_rrrr _tttt_hhhh_eeee _mmmm_iiii_nnnn_uuuu_tttt_eeee _[[[[_0000_,,,, _6666_1111_]]]]  _****_////
  25.                _iiii_nnnn_tttt  _tttt_mmmm______mmmm_iiii_nnnn_;;;;   _////_**** _mmmm_iiii_nnnn_uuuu_tttt_eeee_ssss _aaaa_ffff_tttt_eeee_rrrr _tttt_hhhh_eeee _hhhh_oooo_uuuu_rrrr _[[[[_0000_,,,, _5555_9999_]]]] _****_////
  26.                _iiii_nnnn_tttt  _tttt_mmmm______hhhh_oooo_uuuu_rrrr_;;;;  _////_**** _hhhh_oooo_uuuu_rrrr _ssss_iiii_nnnn_cccc_eeee _mmmm_iiii_dddd_nnnn_iiii_gggg_hhhh_tttt _[[[[_0000_,,,, _2222_3333_]]]] _****_////
  27.                _iiii_nnnn_tttt  _tttt_mmmm______mmmm_dddd_aaaa_yyyy_;;;;  _////_**** _dddd_aaaa_yyyy _oooo_ffff _tttt_hhhh_eeee _mmmm_oooo_nnnn_tttt_hhhh _[[[[_1111_,,,, _3333_1111_]]]] _****_////
  28.                _iiii_nnnn_tttt  _tttt_mmmm______mmmm_oooo_nnnn_;;;;   _////_**** _mmmm_oooo_nnnn_tttt_hhhh_ssss _ssss_iiii_nnnn_cccc_eeee _JJJJ_aaaa_nnnn_uuuu_aaaa_rrrr_yyyy _[[[[_0000_,,,, _1111_1111_]]]] _****_////
  29.                _iiii_nnnn_tttt  _tttt_mmmm______yyyy_eeee_aaaa_rrrr_;;;;  _////_**** _yyyy_eeee_aaaa_rrrr_ssss _ssss_iiii_nnnn_cccc_eeee _1111_9999_0000_0000 _****_////
  30.                _iiii_nnnn_tttt  _tttt_mmmm______wwww_dddd_aaaa_yyyy_;;;;  _////_**** _dddd_aaaa_yyyy_ssss _ssss_iiii_nnnn_cccc_eeee _SSSS_uuuu_nnnn_dddd_aaaa_yyyy _[[[[_0000_,,,, _6666_]]]] _****_////
  31.                _iiii_nnnn_tttt  _tttt_mmmm______yyyy_dddd_aaaa_yyyy_;;;;  _////_**** _dddd_aaaa_yyyy_ssss _ssss_iiii_nnnn_cccc_eeee _JJJJ_aaaa_nnnn_uuuu_aaaa_rrrr_yyyy _1111 _[[[[_0000_,,,, _3333_6666_5555_]]]] _****_////
  32.                _iiii_nnnn_tttt  _tttt_mmmm______iiii_ssss_dddd_ssss_tttt_;;;; _////_**** _ffff_llll_aaaa_gggg _ffff_oooo_rrrr _dddd_aaaa_yyyy_llll_iiii_gggg_hhhh_tttt _ssss_aaaa_vvvv_iiii_nnnn_gggg_ssss _tttt_iiii_mmmm_eeee _****_////
  33.           _}}}}_;;;;
  34.  
  35.      In addition to computing the calendar time, _mmmm_kkkk_tttt_iiii_mmmm_eeee normalizes the
  36.      supplied _tttt_mmmm structure.  The original values of the _tttt_mmmm______wwww_dddd_aaaa_yyyy and _tttt_mmmm______yyyy_dddd_aaaa_yyyy
  37.      components of the structure are ignored, and the original values of the
  38.      other components are not restricted to the ranges indicated in the
  39.      definition of the structure.  On successful completion, the values of the
  40.      _tttt_mmmm______wwww_dddd_aaaa_yyyy and _tttt_mmmm______yyyy_dddd_aaaa_yyyy components are set appropriately, and the other
  41.      components are set to represent the specified calendar time, but with
  42.      their values forced to be within the appropriate ranges.  The final value
  43.      of _tttt_mmmm______mmmm_dddd_aaaa_yyyy is not set until _tttt_mmmm______mmmm_oooo_nnnn and _tttt_mmmm______yyyy_eeee_aaaa_rrrr are determined.
  44.  
  45.      The original values of the components may be either greater than or less
  46.      than the specified range.  For example, a _tttt_mmmm______hhhh_oooo_uuuu_rrrr of -1 means 1 hour
  47.      before midnight, _tttt_mmmm______mmmm_dddd_aaaa_yyyy of 0 means the day preceding the current month,
  48.      and _tttt_mmmm______mmmm_oooo_nnnn of -2 means 2 months before January of _tttt_mmmm______yyyy_eeee_aaaa_rrrr.
  49.  
  50.      If _tttt_mmmm______iiii_ssss_dddd_ssss_tttt is positive, the original values are assumed to be in the
  51.      alternate timezone.  If it turns out that the alternate timezone is not
  52.      valid for the computed calendar time, then the components are adjusted to
  53.      the main timezone.  Likewise, if _tttt_mmmm______iiii_ssss_dddd_ssss_tttt is zero, the original values
  54.      are assumed to be in the main timezone and are converted to the alternate
  55.      timezone if the main timezone is not valid.  If _tttt_mmmm______iiii_ssss_dddd_ssss_tttt is negative, the
  56.      correct timezone is determined and the components are not adjusted.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmkkkkttttiiiimmmmeeee((((3333CCCC))))                                                          mmmmkkkkttttiiiimmmmeeee((((3333CCCC))))
  71.  
  72.  
  73.  
  74.      Local timezone information is used as if _mmmm_kkkk_tttt_iiii_mmmm_eeee had called _tttt_zzzz_ssss_eeee_tttt.
  75.  
  76.      _mmmm_kkkk_tttt_iiii_mmmm_eeee returns the specified calendar time.  If the calendar time cannot
  77.      be represented, the function returns the value (_tttt_iiii_mmmm_eeee______tttt)-1.
  78.  
  79. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  80.      What day of the week is July 4, 2001?
  81.  
  82.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  83.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_tttt_iiii_mmmm_eeee_...._hhhh_>>>>
  84.  
  85.           _ssss_tttt_aaaa_tttt_iiii_cccc _cccc_hhhh_aaaa_rrrr _****_cccc_oooo_nnnn_ssss_tttt _wwww_dddd_aaaa_yyyy_[[[[_]]]] _==== _{{{{
  86.                _""""_SSSS_uuuu_nnnn_dddd_aaaa_yyyy_""""_,,,, _""""_MMMM_oooo_nnnn_dddd_aaaa_yyyy_""""_,,,, _""""_TTTT_uuuu_eeee_ssss_dddd_aaaa_yyyy_""""_,,,, _""""_WWWW_eeee_dddd_nnnn_eeee_ssss_dddd_aaaa_yyyy_""""_,,,,
  87.                _""""_TTTT_hhhh_uuuu_rrrr_ssss_dddd_aaaa_yyyy_""""_,,,, _""""_FFFF_rrrr_iiii_dddd_aaaa_yyyy_""""_,,,, _""""_SSSS_aaaa_tttt_uuuu_rrrr_dddd_aaaa_yyyy_""""_,,,, _""""_----_uuuu_nnnn_kkkk_nnnn_oooo_wwww_nnnn_----_""""
  88.           _}}}}_;;;;
  89.           _ssss_tttt_rrrr_uuuu_cccc_tttt _tttt_mmmm _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_;;;;
  90.           _////_****_...._...._...._****_////
  91.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______yyyy_eeee_aaaa_rrrr    _==== _2222_0000_0000_1111 _---- _1111_9999_0000_0000_;;;;
  92.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______mmmm_oooo_nnnn     _==== _7777 _---- _1111_;;;;
  93.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______mmmm_dddd_aaaa_yyyy    _==== _4444_;;;;
  94.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______hhhh_oooo_uuuu_rrrr    _==== _0000_;;;;
  95.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______mmmm_iiii_nnnn     _==== _0000_;;;;
  96.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______ssss_eeee_cccc          _==== _1111_;;;;
  97.           _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______iiii_ssss_dddd_ssss_tttt   _==== _----_1111_;;;;
  98.           _iiii_ffff _((((_mmmm_kkkk_tttt_iiii_mmmm_eeee_((((_&&&&_tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_))))_====_==== _----_1111_))))
  99.               _tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______wwww_dddd_aaaa_yyyy_====_7777_;;;;
  100.           _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_%%%%_ssss_\\\\_nnnn_""""_,,,, _wwww_dddd_aaaa_yyyy_[[[[_tttt_iiii_mmmm_eeee______ssss_tttt_rrrr_...._tttt_mmmm______wwww_dddd_aaaa_yyyy_]]]]_))))_;;;;
  101.  
  102.  
  103. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  104.      _cccc_tttt_iiii_mmmm_eeee(3C), _gggg_eeee_tttt_eeee_nnnn_vvvv(3C), _tttt_iiii_mmmm_eeee_zzzz_oooo_nnnn_eeee(4).
  105.  
  106. NNNNOOOOTTTTEEEESSSS
  107.      _tttt_mmmm______yyyy_eeee_aaaa_rrrr of the _tttt_mmmm structure must be for year 1970 or later.  Calendar
  108.      times before 00:00:00 UTC, January 1, 1970 or after 03:14:07 UTC, January
  109.      19, 2038 cannot be represented.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.